package com.wjy.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Hello {
    @GetMapping("/hello")
    public  String hello() { return "hello!";}

    //从前端传入两个数字，返回两值相加
    @GetMapping("/add1")
    public Integer Add1(@RequestParam(value = "a") Integer a,@RequestParam(value = "b") Integer b) {
        Integer c=a+b;
        return c;

    }
    //从前端传入一个数字
    @GetMapping("/test3")
    public String Test3(String a) {
        //System.out.println(a);
        return a;

    }

    //从前端传入一个数字
    @GetMapping("/test2")
    public String Test2(@RequestParam(value = "a") String a) {
        //System.out.println(a);
        return a;

    }

    @GetMapping("/test")
    public  String test() { return "111a";}


}
